import request from '@/config/axios'

// 关键设备清单 VO
export interface KeyEquipmentListVO {
  id: number // 序号
  projectNo: string // 项目编号
  projectName: string // 项目名称
  powerStation: string // 所在电站
  unitUsed: string // 所用机组
  equipmentCode: string // 设备编码
  productName: string // 产品名称
  productModel: string // 产品型号
  recommendedLife: string // 推荐使用寿命
  mainEquipmentQuantity: number // 供货主设备数量
  sparePartsQuantity: number // 供货备件数量
  ownerInventoryQuantity: number // 业主库存备件数量
  remarks: string // 备注
}

// 关键设备清单 API
export const KeyEquipmentListApi = {
  // 查询关键设备清单分页
  getKeyEquipmentListPage: async (params: any) => {
    return await request.get({ url: `/om/key-equipment-list/page`, params })
  },

  // 查询关键设备清单详情
  getKeyEquipmentList: async (id: number) => {
    return await request.get({ url: `/om/key-equipment-list/get?id=` + id })
  },

  // 新增关键设备清单
  createKeyEquipmentList: async (data: KeyEquipmentListVO) => {
    return await request.post({ url: `/om/key-equipment-list/create`, data })
  },

  // 修改关键设备清单
  updateKeyEquipmentList: async (data: KeyEquipmentListVO) => {
    return await request.put({ url: `/om/key-equipment-list/update`, data })
  },

  // 删除关键设备清单
  deleteKeyEquipmentList: async (id: number) => {
    return await request.delete({ url: `/om/key-equipment-list/delete?id=` + id })
  },

  // 导出关键设备清单 Excel
  exportKeyEquipmentList: async (params) => {
    return await request.download({ url: `/om/key-equipment-list/export-excel`, params })
  },
}